<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Date"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<style type="text/css">
	.header,.footer{
		height: 50px;
		background-color: #cdcdcd;
	}
	*{
		padding: 0;
		margin: 0;
		font-family: "microsoft yahei";
	}
	a{
		color: blue;
		text-decoration: none;
	}
	.footer{
		position: fixed;
		bottom: 0;
		width: 100%;
		text-align: center;
	}
	.header>ul>li{
		display: inline-block;
		margin: 0px 10px;
		line-height: 50px;
	}
	.footer>span{
		line-height: 50px;
	}
	.menu{
		color: red;
		position: relative;
	}
	.menu>ul{
		display: none;
	}
	.menu>ul>li{
		list-style-type: none;
		height: 25px;
	}
	.menu:hover>ul{
		display: block;
		position: absolute;
	}
	.title{
		text-align: center;
		margin-top: 100px;
	}
	a:hover{
		color:purple;
	}
</style>
<% String path = request.getContextPath(); %>
<div class="header">
	<a style="float: left;" href="${pageContext.request.contextPath}/index.jsp"><img src="${pageContext.request.contextPath}/img/logo.png" height="50px"></a>
	<ul style="float: left;">
		<li><a href="${pageContext.request.contextPath}/show">文件列表</a></li>
		<li class="menu">文件查看
		<ul>
			<li><a href="">法律法规</a></li>
			<li><a href="">管理办法</a></li>
			<li><a href="">决定条例</a></li>
			<li><a href="">细则解释</a></li>
			<li><a href="">规范指南</a></li>
			<li><a href="">其他文件</a></li>
		</ul>
		</li>
		<li class="menu">文件分享
		<ul>
			<li><a href="">分享文件</a></li>
			<li><a href="">我的分享</a></li>
		</ul>
		</li>
		<li>文件检索
			<form action="${pageContext.request.contextPath}/search" method="get" style="display: inline-block;">
				<input type="text" name="keyword" style="height:25ps;"/>
				<input type="image" src="${pageContext.request.contextPath}/img/search.png" width="25px" style="vertical-align: middle;">
			</form>
		</li>
	</ul>
	<ul style="float: right;">
	
		<c:choose>
			<c:when test="${not empty user}">
				<li class="menu" style="width: 80px;text-align:center;">${user.username}
					<ul>
						<li><a href="${pageContext.request.contextPath}/userinfo.jsp">个人信息</a></li>
						<li><a href="modifypassword.jsp">修改密码</a></li>
						<li><a href="">注销账号</a></li>
					</ul>
				</li>
				<li><a href="${pageContext.request.contextPath}/logout">退出</a></li>
			</c:when>
			<c:otherwise>
				<li><a href="${pageContext.request.contextPath}/regist.jsp">注册</a></li>
				<li><a href="${pageContext.request.contextPath}/login.jsp">登录</a></li>
			</c:otherwise>
		</c:choose>
	</ul>
</div>
<%
	Date today = new Date();
%>
<div class="footer">
	<span>攀枝花学院&copy;<b>hmye3</b>2021-<%= new SimpleDateFormat("yyyy").format(today) %></span>
	<span>网址访问量:${empty vistor ?0:vistor}</span>
	<span>当前在线人数${empty online ?0:online}</span>
</div>